-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop #3421
Develop #3421
Conversation
src/style.css
Outdated
.stars--1 .stars__star:nth-child(-n + 1) { | ||
margin: 0 4px; | ||
width: 16px; | ||
height: 16px; | ||
background-image: url(../src/images/star-active.svg); | ||
background-repeat: no-repeat; | ||
} | ||
|
||
.stars--2 .stars__star:nth-child(-n + 2) { | ||
margin: 0 4px; | ||
width: 16px; | ||
height: 16px; | ||
background-image: url(../src/images/star-active.svg); | ||
background-repeat: no-repeat; | ||
} | ||
|
||
.stars--3 .stars__star:nth-child(-n + 3) { | ||
margin: 0 4px; | ||
width: 16px; | ||
height: 16px; | ||
background-image: url(../src/images/star-active.svg); | ||
background-repeat: no-repeat; | ||
} | ||
|
||
.stars--4 .stars__star:nth-child(-n + 4) { | ||
margin: 0 4px; | ||
width: 16px; | ||
height: 16px; | ||
background-image: url(../src/images/star-active.svg); | ||
background-repeat: no-repeat; | ||
} | ||
|
||
.stars--5 .stars__star:nth-child(-n + 5) { | ||
margin: 0 4px; | ||
width: 16px; | ||
height: 16px; | ||
background-image: url(../src/images/star-active.svg); | ||
background-repeat: no-repeat; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- you have most of styles at the common class selector stars__star
- you can list as a group
.stars--1 .stars__star:nth-child(-n + 1) { | |
margin: 0 4px; | |
width: 16px; | |
height: 16px; | |
background-image: url(../src/images/star-active.svg); | |
background-repeat: no-repeat; | |
} | |
.stars--2 .stars__star:nth-child(-n + 2) { | |
margin: 0 4px; | |
width: 16px; | |
height: 16px; | |
background-image: url(../src/images/star-active.svg); | |
background-repeat: no-repeat; | |
} | |
.stars--3 .stars__star:nth-child(-n + 3) { | |
margin: 0 4px; | |
width: 16px; | |
height: 16px; | |
background-image: url(../src/images/star-active.svg); | |
background-repeat: no-repeat; | |
} | |
.stars--4 .stars__star:nth-child(-n + 4) { | |
margin: 0 4px; | |
width: 16px; | |
height: 16px; | |
background-image: url(../src/images/star-active.svg); | |
background-repeat: no-repeat; | |
} | |
.stars--5 .stars__star:nth-child(-n + 5) { | |
margin: 0 4px; | |
width: 16px; | |
height: 16px; | |
background-image: url(../src/images/star-active.svg); | |
background-repeat: no-repeat; | |
} | |
.stars--1 .stars__star:nth-child(-n + 1), | |
.stars--2 .stars__star:nth-child(-n + 2), | |
.stars--3 .stars__star:nth-child(-n + 3), | |
.stars--4 .stars__star:nth-child(-n + 4), | |
.stars--5 .stars__star:nth-child(-n + 5) { | |
background-image: url(../src/images/star-active.svg); | |
} |
} | ||
|
||
.stars__star { | ||
margin: 0 4px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's better use :not(:last-child)
to set margin-right to all stars besides last one
src/index.html
Outdated
<div class="stars__star c"></div> | ||
<div class="stars__star c"></div> | ||
<div class="stars__star c"></div> | ||
<div class="stars__star c"></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove redundant selectors
<div class="stars__star c"></div> | |
<div class="stars__star c"></div> | |
<div class="stars__star c"></div> | |
<div class="stars__star c"></div> | |
<div class="stars__star"></div> | |
<div class="stars__star"></div> | |
<div class="stars__star"></div> | |
<div class="stars__star"></div> |
src/index.html
Outdated
</div> | ||
|
||
<div class="stars stars--5"> | ||
<div class="stars__star c"></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same
https://DudeMood.github.io/layout_stars/
https://DudeMood.github.io/layout_stars/report/html_report/